import { Define, EntityObjectFactory } from 'tiny-entity2';
const EntityObjectType = EntityObjectFactory.GetEntityObjectType(process.env.dataBaseType || 'mysql');
@Define.Table({ TableName: 'kitchenorderitem' })
export class KitchenOrderItem extends EntityObjectType<KitchenOrderItem>{
    @Define.PrimaryKey()
    id: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    storeId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true
    })
    orderItemId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        NotAllowNULL: true,
        IsIndex: true
    })
    kitchenOrderId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    kitchenSolutionId: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    productName: string;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    productId: string;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DefaultValue: 0
    })
    qty: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR
    })
    note: string;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DefaultValue: 0
    })
    refundQty: number;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    produceTime: number;

    @Define.Column({
        DataType: Define.DataType.Decimal,
        DefaultValue: 0
    })
    produceQty: number;

    @Define.Column({
        DataType: Define.DataType.VARCHAR,
        DefaultValue: 'init'
    })
    status: string;

    @Define.Column({
        DataType: Define.DataType.BIGINT
    })
    version: number;
}

export const KitchenOrderItemStatus = {
    Init: 'init',
    Produced: 'produced',
    Refunded: 'refunded'
}